<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2022-12-28 10:59:58
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-12-28 11:04:43
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 求两个数的和   

        function add(num1,num2){
            alert(num1+num2);
        }

        var res1 = add(10,20);
        var res2 = add(100,200);
        var res3 = add(1000,2000);

        console.log(res1,res2,res3); // undefined undefined undefined
    
        
        function add(num1,num2){
            return num1+num2;
        }

        var res4 = add(10,20);  // 拿到结果
        var res5 = add(100,200); // 拿到结果
        var res6 = add(1000,2000); // 拿到结果

        console.log(res4,res5,res6); 
    
    </script>
</body>
</html>